package cn.edu.cug.cs.gtl.docsrv.raw.service.impl;

import cn.edu.cug.cs.gtl.docsrv.raw.catalog.CatalogTree;
import cn.edu.cug.cs.gtl.docsrv.raw.dao.RawDao;
import cn.edu.cug.cs.gtl.docsrv.raw.service.RawService;
import cn.edu.cug.cs.gtl.mybatis.mapper.raw.RawAll;
import cn.edu.cug.cs.gtl.mybatis.mapper.raw.RawCatalog;
import cn.edu.cug.cs.gtl.mybatis.mapper.raw.RawItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

@Component
public class RawServiceImpl implements RawService {

    @Autowired
    RawDao rawDao;

    @Override
    public CatalogTree getCatalogTree() {
        return rawDao.getCatalogTree();
    }

//    @Override
//    public RawAll getRawByInternalId(BigDecimal rawInternalId) {
//        return rawDao.getRawByInternalId(rawInternalId);
//    }
    @Override
    public List<RawItem> getRawByInternalId(BigDecimal rawInternalId) {
        return rawDao.getRawByInternalId(rawInternalId);
    }

    @Override
    public boolean addRaw(RawAll rawAll) {
        return rawDao.addRaw(rawAll);
    }

    @Override
    public void addRawCatalog(RawCatalog rawCatalog) {

        rawDao.addRawCatalog(rawCatalog);
    }

    @Override
    public void updateRawData(RawAll rawAll) {
        rawDao.updateRawData(rawAll);

    }
}
